package com.maimang.platform.shiro.filter;

import org.apache.shiro.authc.AuthenticationToken;
import org.apache.shiro.subject.Subject;
import org.apache.shiro.web.filter.authc.FormAuthenticationFilter;
import org.apache.shiro.web.util.WebUtils;

import javax.servlet.ServletRequest;
import javax.servlet.ServletResponse;

/**
 * @classname MyFormAuthenticationFilter
 * @description <br>自定义FormAuthenticationFilter</br>
 * @author  Rocky
 * @date    2019-11-14 16:51
 * @email   jintaozhao@qq.com
 * @version 1.0.0
 */
public class MyFormAuthenticationFilter extends FormAuthenticationFilter {

	@Override
	protected boolean onLoginSuccess(AuthenticationToken token, Subject subject, ServletRequest request, ServletResponse response) throws Exception {
		String successUrl = "/index";
		WebUtils.issueRedirect(request, response, successUrl);
		return false;
	}
}
